package com.swensen.game.editor.data;

/**
 * The Class Bounds.
 */
public class Bounds {
	
	/** The height. */
	private int height;
	
	/** The min x. */
	private int minX;
	
	/** The min y. */
	private int minY;
	
	/** The width. */
	private int width;

	/**
	 * Instantiates a new bounds.
	 *
	 * @param top the top
	 * @param left the left
	 * @param width the width
	 * @param height the height
	 */
	public Bounds(int top, int left, int width, int height) {
		this.minX = left;
		this.minY = top;
		this.setWidth(width);
		this.setHeight(height);
	}

	/**
	 * Gets the height.
	 *
	 * @return the height
	 */
	public int getHeight() {
		return height;
	}

	/**
	 * Gets the max x.
	 *
	 * @return the max x
	 */
	public int getMaxX() {
		return minX + width;
	}

	/**
	 * Gets the max y.
	 *
	 * @return the max y
	 */
	public int getMaxY() {
		return minY + height;
	}

	/**
	 * Gets the min x.
	 *
	 * @return the min x
	 */
	public int getMinX() {
		return minX;
	}

	/**
	 * Gets the min y.
	 *
	 * @return the min y
	 */
	public int getMinY() {
		return minY;
	}

	/**
	 * Gets the width.
	 *
	 * @return the width
	 */
	public int getWidth() {
		return width;
	}

	/**
	 * Sets the height.
	 *
	 * @param height the new height
	 */
	public void setHeight(int height) {
		this.height = height;
	}

	/**
	 * Sets the max x.
	 *
	 * @param maxX the new max x
	 */
	public void setMaxX(int maxX) {
		this.width = maxX - minX;
	}

	/**
	 * Sets the max y.
	 *
	 * @param maxY the new max y
	 */
	public void setMaxY(int maxY) {
		this.height = maxY - minY;
	}

	/**
	 * Sets the min x.
	 *
	 * @param minX the new min x
	 */
	public void setMinX(int minX) {
		this.minX = minX;
	}

	/**
	 * Sets the min y.
	 *
	 * @param minY the new min y
	 */
	public void setMinY(int minY) {
		this.minY = minY;
	}

	/**
	 * Sets the width.
	 *
	 * @param width the new width
	 */
	public void setWidth(int width) {
		this.width = width;
	}
}
